import { reqsearchList } from "@/api";

const state = {
  getsearchList: {},
};
const mutations = {
  GEISEARCHLIST(state, getsearchList) {
    state.getsearchList = getsearchList;
  },
};
const actions = {
  async getsearchList({ commit }, params = {}) {
    let result = await reqsearchList(params);
    if (result.code == 200) {
      commit("GEISEARCHLIST", result.data);
    }
  },
};
const getters = {
  attrsList(state) {
    return state.getsearchList.attrsList || [];
  },
  goodsList(state) {
    return state.getsearchList.goodsList || [];
  },
  trademarkList(state) {
    return state.getsearchList.trademarkList || [];
  },
};

export default {
  state,
  mutations,
  actions,
  getters,
};
